home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 22.6 KB | 715 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWMnuItm.cpp
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #include "FWOS.hpp"
-
- #ifndef FWMNUITM_H
- #include "FWMnuItm.h"
- #endif
-
- #ifndef FWMENUS_K
- #include "FWMenus.k"
- #endif
-
- #ifndef FWPULLDM_H
- #include "FWPullDM.h"
- #endif
-
- #ifndef FWMNUBAR_H
- #include "FWMnuBar.h"
- #endif
-
- // ----- Foundation Includes -----
-
- #ifndef FWSTREAM_H
- #include "FWStream.h"
- #endif
-
- #ifndef FWSTRING_H
- #include "FWString.h"
- #endif
-
- // ----- OpenDoc Utility Includes -----
-
- #ifndef _ITEXT_
- #include "IText.h"
- #endif
-
- // ----- OpenDoc Includes -----
-
- #ifndef SOM_ODMenuBar_xh
- #include <MenuBar.xh>
- #endif
-
- // ----- Macintosh Includes -----
-
- #if defined(FW_BUILD_MAC) && !defined(__SCRIPT__)
- #include <Script.h>
- #endif
-
- //========================================================================================
- // File scope definitions
- //========================================================================================
-
- #ifdef FW_BUILD_MAC
- #pragma segment fwmenu
- #endif
-
- //========================================================================================
- // Template Instantiations
- //========================================================================================
-
- FW_DEFINE_AUTO_TEMPLATE(FW_TOrderedCollectionIterator, FW_CMenuItem)
- FW_DEFINE_AUTO_TEMPLATE(FW_TOrderedCollection, FW_CMenuItem)
-
- #ifdef FW_USE_TEMPLATE_PRAGMAS
-
- #pragma template_access public
- #pragma template FW_TOrderedCollection<FW_CMenuItem>
- #pragma template FW_TOrderedCollectionIterator<FW_CMenuItem>
-
- #endif
-
- //========================================================================================
- // class FW_CMenuItem
- //========================================================================================
-
- FW_DEFINE_AUTO(FW_CMenuItem)
- FW_DEFINE_CLASS_M0(FW_CMenuItem)
-
- // This class is archivable, but we provide the archiving implementation in a separate
- // translation unit in order to enable deadstripping of the archiving-related code
- // in parts that do not use archiving with this class.
-
- //----------------------------------------------------------------------------------------
- // FW_CMenuItem::FW_CMenuItem
- //----------------------------------------------------------------------------------------
-
- FW_CMenuItem::FW_CMenuItem(Environment* ev, FW_CReadableStream& stream) :
- fOwnerMenu(NULL),
- fIndex(0)
- #ifdef FW_BUILD_MAC
- ,fCommandID(FW_kNoCommand)
- #endif
- {
- FW_UNUSED(ev);
- stream >> fIndex;
- FW_READ_DYNAMIC_OBJECT(stream, &fOwnerMenu, FW_CPullDownMenu);
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMenuItem::FW_CMenuItem
- //----------------------------------------------------------------------------------------
-
- FW_CMenuItem::FW_CMenuItem(Environment* ev, FW_CPullDownMenu* ownerMenu, short index) :
- fOwnerMenu(ownerMenu),
- fIndex(index)
- #ifdef FW_BUILD_MAC
- ,fCommandID(FW_kNoCommand)
- #endif
- {
- FW_UNUSED(ev);
- FW_ASSERT(ownerMenu != NULL);
- FW_ASSERT(index > 0);
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMenuItem::~FW_CMenuItem
- //----------------------------------------------------------------------------------------
-
- FW_CMenuItem::~FW_CMenuItem()
- {
- FW_START_DESTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMenuItem::GetCommandID
- //----------------------------------------------------------------------------------------
-
- ODCommandID FW_CMenuItem::GetCommandID(Environment* ev) const
- {
- FW_UNUSED(ev);
- FW_ASSERT(fOwnerMenu != NULL);
-
- #ifdef FW_BUILD_MAC
- return fCommandID;
- #endif
-
- #ifdef FW_BUILD_WIN
- return fOwnerMenu->GetCommandID(ev, fIndex);
- #endif
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMenuItem::PrivGetMenuItem
- //----------------------------------------------------------------------------------------
-
- FW_CMenuItem* FW_CMenuItem::PrivGetMenuItem(Environment* ev, ODCommandID commandID) const
- {
- FW_UNUSED(ev);
- FW_UNUSED(commandID);
- return NULL;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMenuItem::PrivFindMenuWithID
- //----------------------------------------------------------------------------------------
-
- FW_CPullDownMenu* FW_CMenuItem::PrivFindMenuWithID(Environment* ev, ODMenuID menuID) const
- {
- FW_UNUSED(ev);
- FW_UNUSED(menuID);
- return NULL;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMenuItem::PrivDisableAll
- //----------------------------------------------------------------------------------------
-
- void FW_CMenuItem::PrivDisableAll(Environment* ev)
- {
- FW_UNUSED(ev);
- // Nothing to do on the Mac because FW_CPullDownMenu::DisableAll disables all its items
- // at once
-
- #ifdef FW_BUILD_WIN
- HMENU hMenu = fOwnerMenu->GetPlatformMenu(ev).menu;
- ::EnableMenuItem(hMenu, fIndex - 1, MF_BYPOSITION | MF_DISABLED | MF_GRAYED);
- #endif
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMenuItem::PrivEnableAll
- //----------------------------------------------------------------------------------------
-
- void FW_CMenuItem::PrivEnableAll(Environment* ev)
- {
- FW_UNUSED(ev);
- // Nothing to do on the Mac because FW_CPullDownMenu::EnableAll enables all its items
- // at once
-
- #ifdef FW_BUILD_WIN
- HMENU hMenu = fOwnerMenu->GetPlatformMenu(ev).menu;
- ::EnableMenuItem(hMenu, fIndex - 1, MF_BYPOSITION | MF_ENABLED);
- #endif
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMenuItem::PrivAttach
- //----------------------------------------------------------------------------------------
-
- void FW_CMenuItem::PrivAttach(Environment* ev, FW_CMenuBar* menuBar)
- {
- FW_UNUSED(ev);
- FW_UNUSED(menuBar);
- // Nothing to do
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMenuItem::PrivDetach
- //----------------------------------------------------------------------------------------
-
- void FW_CMenuItem::PrivDetach(Environment* ev, FW_CMenuBar* menuBar)
- {
- FW_UNUSED(ev);
- FW_UNUSED(menuBar);
- // Nothing to do
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMenuItem::Flatten
- //----------------------------------------------------------------------------------------
-
- void FW_CMenuItem::Flatten(Environment* ev, FW_CWritableStream& stream)
- {
- FW_UNUSED(ev);
- FW_WRITE_DYNAMIC_OBJECT(stream, fOwnerMenu, FW_CPullDownMenu);
- }
-
- //========================================================================================
- // class FW_CSeparatorItem
- //========================================================================================
-
- FW_DEFINE_AUTO(FW_CSeparatorItem)
- FW_DEFINE_CLASS_M1(FW_CSeparatorItem, FW_CMenuItem)
-
- // This class is archivable, but we provide the archiving implementation in a separate
- // translation unit in order to enable deadstripping of the archiving-related code
- // in parts that do not use archiving with this class.
-
- //----------------------------------------------------------------------------------------
- // FW_CSeparatorItem::FW_CSeparatorItem
- //----------------------------------------------------------------------------------------
-
- FW_CSeparatorItem::FW_CSeparatorItem(Environment* ev, FW_CReadableStream& stream) :
- FW_CMenuItem(ev, stream)
- {
- InitSeparator(ev, fOwnerMenu->GetPlatformMenu(ev));
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CSeparatorItem::FW_CSeparatorItem
- //----------------------------------------------------------------------------------------
-
- FW_CSeparatorItem::FW_CSeparatorItem(Environment* ev, FW_CPullDownMenu* ownerMenu, short index) :
- FW_CMenuItem(ev, ownerMenu, index)
- {
- InitSeparator(ev, ownerMenu->GetPlatformMenu(ev));
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CSeparatorItem::~FW_CSeparatorItem
- //----------------------------------------------------------------------------------------
-
- FW_CSeparatorItem::~FW_CSeparatorItem()
- {
- FW_START_DESTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CSeparatorItem::InitSeparator
- //----------------------------------------------------------------------------------------
-
- void FW_CSeparatorItem::InitSeparator(Environment* ev, const ODPlatformMenu& platformMenu)
- {
- FW_UNUSED(ev);
- #ifdef FW_BUILD_MAC
- fCommandID = FW_kSeparatorCommand;
- ::InsertMenuItem(platformMenu, "\p-", fIndex - 1);
- #endif
-
- #ifdef FW_BUILD_WIN
- ::InsertMenu(platformMenu.menu, fIndex, MF_BYPOSITION | MF_SEPARATOR, 0, NULL);
- #endif
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CSeparatorItem::PrivDisableAll
- //----------------------------------------------------------------------------------------
-
- void FW_CSeparatorItem::PrivDisableAll(Environment* ev)
- {
- FW_UNUSED(ev);
- // Nothing to do. Already disabled
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CSeparatorItem::PrivEnableAll
- //----------------------------------------------------------------------------------------
-
- void FW_CSeparatorItem::PrivEnableAll(Environment* ev)
- {
- FW_UNUSED(ev);
- // Should never enable it
- }
-
- //========================================================================================
- // class FW_CTextItem
- //========================================================================================
-
- FW_DEFINE_AUTO(FW_CTextItem)
- FW_DEFINE_CLASS_M1(FW_CTextItem, FW_CMenuItem)
-
- // This class is archivable, but we provide the archiving implementation in a separate
- // translation unit in order to enable deadstripping of the archiving-related code
- // in parts that do not use archiving with this class.
-
- //----------------------------------------------------------------------------------------
- // FW_CTextItem::FW_CTextItem
- //----------------------------------------------------------------------------------------
-
- FW_CTextItem::FW_CTextItem(Environment* ev, FW_CReadableStream& stream) :
- FW_CMenuItem(ev, stream)
- {
- ODCommandID commandID;
- stream >> commandID;
-
- FW_MenuKey menuKey;
- stream >> menuKey;
-
- FW_CString text;
- stream >> text;
-
- PrivInitTextItem(ev, fOwnerMenu->GetPlatformMenu(ev), text, commandID, menuKey);
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CTextItem::FW_CTextItem
- //----------------------------------------------------------------------------------------
-
- FW_CTextItem::FW_CTextItem(Environment* ev,
- FW_CPullDownMenu* ownerMenu,
- short index,
- const FW_CString& text,
- ODCommandID commandID,
- FW_MenuKey menuKey) :
- FW_CMenuItem(ev, ownerMenu, index)
- {
- FW_ASSERT(commandID > 0);
- PrivInitTextItem(ev, ownerMenu->GetPlatformMenu(ev), text, commandID, menuKey);
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CTextItem::~FW_CTextItem
- //----------------------------------------------------------------------------------------
-
- FW_CTextItem::~FW_CTextItem()
- {
- FW_START_DESTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CTextItem::PrivInitTextItem
- //----------------------------------------------------------------------------------------
-
- void FW_CTextItem::PrivInitTextItem(Environment* ev,
- const ODPlatformMenu& platformMenu,
- const FW_CString& text,
- ODCommandID commandID,
- FW_MenuKey menuKey)
- {
- FW_UNUSED(ev);
- FW_ASSERT(commandID >= FW_kFirstUserCommandID);
-
- #ifdef FW_BUILD_MAC
- fCommandID = commandID;
-
- Str255 str;
- text.ExportPascal(str);
- ::InsertMenuItem(platformMenu, "\pabc", fIndex - 1);
- ::SetMenuItemText(platformMenu, fIndex, str);
-
- ODScriptCode systemScriptCode = (ODScriptCode) ::GetScriptManagerVariable(smSysScript);
- FW_Locale locale;
- text.GetLocale(locale);
- if (locale.fScriptCode != systemScriptCode)
- { // set this menu item's script code
- ::SetItemCmd(platformMenu, fIndex, FW_kPrivMacScriptCodeKeyEquivalent);
- ::SetItemIcon(platformMenu, fIndex, locale.fScriptCode);
- menuKey = FW_kNoKeyEquivalent; // so that code below doesn't mess up the key field we just set
- }
-
- if (menuKey != FW_kNoKeyEquivalent)
- ::SetItemCmd(platformMenu, fIndex, menuKey & FW_kPrivMacMenuKeyCharMask);
- #endif
-
- #ifdef FW_BUILD_WIN
- char szText[256];
- text.ExportCString(szText);
- ::InsertMenu(platformMenu.menu, fIndex, MF_BYPOSITION | MF_STRING | MF_DISABLED | MF_UNCHECKED, commandID, szText);
- //::AppendMenu(platformMenu.menu, MF_STRING | MF_DISABLED | MF_UNCHECKED, commandID, text);
-
- // [HLX] No way yet to build accelerator table
- FW_UNUSED(menuKey);
- #endif
- }
-
- #ifdef FW_BUILD_MAC
- //----------------------------------------------------------------------------------------
- // FW_CTextItem::PrivAttach
- //----------------------------------------------------------------------------------------
-
- void FW_CTextItem::PrivAttach(Environment* ev, FW_CMenuBar* menuBar)
- {
- menuBar->PrivMacRegisterCommand(ev, fCommandID, fOwnerMenu->GetMenuID(ev), fIndex);
- }
- #endif
-
- #ifdef FW_BUILD_MAC
- //----------------------------------------------------------------------------------------
- // FW_CTextItem::PrivDetach
- //----------------------------------------------------------------------------------------
-
- void FW_CTextItem::PrivDetach(Environment* ev, FW_CMenuBar* menuBar)
- {
- menuBar->PrivMacUnregisterCommand(ev, fCommandID);
- }
- #endif
-
- //----------------------------------------------------------------------------------------
- // FW_CTextItem::Flatten
- //----------------------------------------------------------------------------------------
-
- void FW_CTextItem::Flatten(Environment* ev, FW_CWritableStream& stream)
- {
- FW_CMenuItem::Flatten(ev, stream);
-
- FW_CMenuBar* menuBar = fOwnerMenu->GetMenuBar(ev);
-
- ODCommandID commandID = GetCommandID(ev);
- stream << commandID;
-
- FW_MenuKey menuKey = menuBar->GetMenuKey(ev, commandID);
- stream << menuKey;
-
- FW_CString text;
- menuBar->GetItemString(ev, commandID, text);
- stream << text;
- }
-
- //========================================================================================
- // class FW_CToggleItem
- //========================================================================================
-
- FW_DEFINE_AUTO(FW_CToggleItem)
- FW_DEFINE_CLASS_M1(FW_CToggleItem, FW_CTextItem)
-
- // This class is archivable, but we provide the archiving implementation in a separate
- // translation unit in order to enable deadstripping of the archiving-related code
- // in parts that do not use archiving with this class.
-
- //----------------------------------------------------------------------------------------
- // FW_CToggleItem::FW_CToggleItem
- //----------------------------------------------------------------------------------------
-
- FW_CToggleItem::FW_CToggleItem(Environment* ev, FW_CReadableStream& stream) :
- FW_CTextItem(ev, stream),
- fToggleState(true)
- {
- stream >> fOtherText;
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CToggleItem::FW_CToggleItem
- //----------------------------------------------------------------------------------------
-
- FW_CToggleItem::FW_CToggleItem(Environment* ev,
- FW_CPullDownMenu* ownerMenu,
- short index,
- const FW_CString& trueText,
- const FW_CString& falseText,
- ODCommandID commandID,
- FW_MenuKey menuKey) :
- FW_CTextItem(ev, ownerMenu, index, trueText, commandID, menuKey),
- fToggleState(true)
- {
- fOtherText = falseText;
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CToggleItem::~FW_CToggleItem
- //----------------------------------------------------------------------------------------
-
- FW_CToggleItem::~FW_CToggleItem()
- {
- FW_START_DESTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CToggleItem::ToggleItem
- //----------------------------------------------------------------------------------------
-
- void FW_CToggleItem::ToggleItem(Environment* ev, FW_Boolean newState)
- {
- if (newState == fToggleState)
- return;
-
- FW_CMenuBar* menuBar = fOwnerMenu->GetMenuBar(ev);
-
- FW_CString currentText;
- menuBar->GetItemString(ev, GetCommandID(ev), currentText);
-
- fToggleState = newState;
-
- menuBar->SetItemString(ev, GetCommandID(ev), fOtherText);
-
- fOtherText = currentText;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CToggleItem::Flatten
- //----------------------------------------------------------------------------------------
-
- void FW_CToggleItem::Flatten(Environment* ev, FW_CWritableStream& stream)
- {
- FW_CTextItem::Flatten(ev, stream);
-
- stream << fOtherText;
- }
-
- //========================================================================================
- // class FW_CSubMenuItem
- //========================================================================================
-
- FW_DEFINE_AUTO(FW_CSubMenuItem)
- FW_DEFINE_CLASS_M1(FW_CSubMenuItem, FW_CMenuItem)
-
- // This class is archivable, but we provide the archiving implementation in a separate
- // translation unit in order to enable deadstripping of the archiving-related code
- // in parts that do not use archiving with this class.
-
- //----------------------------------------------------------------------------------------
- // FW_CSubMenuItem::FW_CSubMenuItem
- //----------------------------------------------------------------------------------------
-
- FW_CSubMenuItem::FW_CSubMenuItem(Environment* ev, FW_CReadableStream& stream) :
- FW_CMenuItem(ev, stream)
- {
- FW_READ_DYNAMIC_OBJECT(stream, &fSubMenu, FW_CPullDownMenu);
-
- PrivInitSubMenu(ev, fOwnerMenu->GetPlatformMenu(ev));
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CSubMenuItem::FW_CSubMenuItem
- //----------------------------------------------------------------------------------------
-
- FW_CSubMenuItem::FW_CSubMenuItem(Environment* ev,
- FW_CPullDownMenu* ownerMenu,
- short index,
- FW_CPullDownMenu* adoptSubMenu):
- FW_CMenuItem(ev, ownerMenu, index),
- fSubMenu(adoptSubMenu)
- {
- FW_ASSERT(adoptSubMenu != NULL);
- PrivInitSubMenu(ev, ownerMenu->GetPlatformMenu(ev));
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CSubMenuItem::~FW_CSubMenuItem
- //----------------------------------------------------------------------------------------
-
- FW_CSubMenuItem::~FW_CSubMenuItem()
- {
- FW_START_DESTRUCTOR
- delete fSubMenu;
- fSubMenu = NULL;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CSubMenuItem::PrivInitSubMenu
- //----------------------------------------------------------------------------------------
-
- void FW_CSubMenuItem::PrivInitSubMenu(Environment* ev, const ODPlatformMenu& platformMenu)
- {
- const ODPlatformMenu& subPlatformMenu = fSubMenu->GetPlatformMenu(ev);
-
- #ifdef FW_BUILD_MAC
- fSubMenu->SetParentMenuItem(ev, this);
-
- // ----- Add it -----
- ::InsertMenuItem(platformMenu, "\pabc", fIndex - 1);
-
- ::HLock((Handle)subPlatformMenu);
- ::SetMenuItemText(platformMenu, fIndex, (*subPlatformMenu)->menuData);
- ::HUnlock((Handle)subPlatformMenu);
-
- // ----- Set the cmd key to hMenuCmd to specify sub menu
- ::SetItemCmd(platformMenu, fIndex, hMenuCmd); // has sub menu
-
- // ----- The menu id of the submenu is in the mark character
- // We don't set the item mark because we don't know yet the
- // ID of the sub menu. Will be done by PrivAttachedToMenuBar.
- #endif
-
- #ifdef FW_BUILD_WIN
- ::InsertMenu(platformMenu.menu,
- fIndex,
- MF_BYPOSITION | MF_POPUP,
- (UINT) subPlatformMenu.menu,
- subPlatformMenu.strMenu);
- #endif
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CSubMenuItem::PrivFindMenuWithID
- //----------------------------------------------------------------------------------------
-
- FW_CPullDownMenu* FW_CSubMenuItem::PrivFindMenuWithID(Environment* ev, ODMenuID menuID) const
- {
- if (fSubMenu->GetMenuID(ev) == menuID)
- return fSubMenu;
- else
- return fSubMenu->PrivFindMenuWithID(ev, menuID);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CSubMenuItem::PrivGetMenuItem
- //----------------------------------------------------------------------------------------
-
- FW_CMenuItem* FW_CSubMenuItem::PrivGetMenuItem(Environment* ev, ODCommandID commandID) const
- {
- return fSubMenu->PrivGetMenuItem(ev, commandID);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CSubMenuItem::PrivDisableAll
- //----------------------------------------------------------------------------------------
-
- void FW_CSubMenuItem::PrivDisableAll(Environment* ev)
- {
- // FW_CMenuItem::PrivDisableAll(ev);
-
- fSubMenu->DisableAll(ev);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CSubMenuItem::PrivEnableAll
- //----------------------------------------------------------------------------------------
-
- void FW_CSubMenuItem::PrivEnableAll(Environment* ev)
- {
- FW_CMenuItem::PrivEnableAll(ev);
-
- fSubMenu->EnableAll(ev);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CSubMenuItem::PrivAttach
- //----------------------------------------------------------------------------------------
-
- void FW_CSubMenuItem::PrivAttach(Environment* ev, FW_CMenuBar* menuBar)
- {
- ODMenuID subMenuID = fSubMenu->PrivAcquireMenuID(ev, menuBar);
- #ifdef FW_BUILD_MAC
- ::SetItemMark(fOwnerMenu->GetPlatformMenu(ev), fIndex, (FW_Char)subMenuID);
- #endif
-
- menuBar->PrivAddSubMenu(ev, subMenuID, fSubMenu->GetPlatformMenu(ev));
-
- fSubMenu->PrivAttach(ev, menuBar);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CSubMenuItem::PrivDetach
- //----------------------------------------------------------------------------------------
-
- void FW_CSubMenuItem::PrivDetach(Environment* ev, FW_CMenuBar* menuBar)
- {
- #ifdef FW_BUILD_MAC
- ::SetItemMark(fOwnerMenu->GetPlatformMenu(ev), fIndex, (FW_Char)0xFF);
- #endif
- menuBar->PrivRemoveMenu(ev, fSubMenu->GetMenuID(ev));
-
- fSubMenu->PrivRelinquishMenuID(ev);
-
- fSubMenu->PrivDetach(ev, menuBar);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CSubMenuItem::Flatten
- //----------------------------------------------------------------------------------------
-
- void FW_CSubMenuItem::Flatten(Environment* ev, FW_CWritableStream& stream)
- {
- FW_CMenuItem::Flatten(ev, stream);
-
- FW_WRITE_DYNAMIC_OBJECT(stream, fSubMenu, FW_CPullDownMenu);
- }
-